
var now_index = 0, obj_leg;

function _preload(_url) {
    return new Promise(function (resolve, reject) {
        $.ajax({
            method: "get",
            url: _url,
            success: function (data) {
                resolve(data);
            }
        })
    })
}

_preload("../js/resourses.json").then(function (data) {
    function progress_img() {
        obj_leg = Object.keys(data).length;
        var img = new Image();
        img.src = data[Object.keys(data)[now_index++]];
        if (now_index < obj_leg) {
            progress_img();
        }
    }
    progress_img();
}, function (msg) {

})



